package controllers;

import views.html.*;
import models.Parent;
import models.Student;
import play.mvc.Controller;
import play.mvc.Result;

// @Authenticated
public class Application extends Controller {
	// static Form<Task> taskForm = Form.form(Task.class);

	public static Result index() {
		// return redirect(routes.Application.tasks());
		// return ok(index.render("Your new application is ready."));
		// return ok("Hello World");

		return ok(views.html.index
				.render(Student.find.all(), Parent.find.all()));
	}

	// public static Result tasks() {
	// return ok(views.html.index.render(Task.all(), taskForm));
	// }

	// public static Result newTask() {
	// Form<Task> filledForm = taskForm.bindFromRequest();
	// if (filledForm.hasErrors()) {
	// return badRequest(views.html.index.render(Task.all(), filledForm));
	//
	// }
	// else {
	// Task.create(filledForm.get());
	// return redirect(routes.Application.tasks());
	// }
	// }
	//
	// public static Result deleteTask(Long id) {
	// Task.delete(id);
	// return redirect(routes.Application.tasks());
	// }

	public static Result newIndex() {
		return ok("Hello. This is new index");
		// return ok("Request: " + request());
		// return temporaryRedirect("/tasks");
	}
}
